Skip to content

项目中已经有gateway网关服务,采用nacos+higress实现存量api转为mcp服务相关问题 #13436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
panda-ace opened this issue May 27, 2025 · 4 comments
Labels
kind/question Category issues related to questions or problems

Comments

@panda-ace
Copy link

在既有项目中采用的是gateway网关服务,我遇到的一个问题就是,我的项目每个请求都得经过网关服务,然后拿取相关租户,鉴权信息,携带这些信息路由到业务服务中,如果按照nacos+higress的方式配置mcp服务的话,那么我如何做到higress搭建AI网关,mcp tools是经过nacos上配置提示词,如何higress路由到相关服务的时候,路由到网关服务,再由网关服务路由到其他业务服务。
本地注册上去的服务

Image

这下边是我的创建的mcp服务

Image
Image

如上图,如果我想要将auth服务的某个接口转为mcp服务,要求是经过网关服务,网关服务拿取相关信息,再让网关服务路由到auth服务,那么是否应该像我上边这么配置

@panda-ace
Copy link
Author

Nacos的MCP Server的服务引用是强绑定的吗?比如我要将user服务的某个接口工具化,就需要将服务引用绑定到对应的user服务上吗?不能绑定到gateway服务上,然后让gateway服务去进行中转吗?

@panda-ace
Copy link
Author

Is the service reference of Nacos MCP Server strongly bound? For example, if I want to instrumentalize a certain interface of a user service, do I need to bind the service reference to the corresponding user service? Can't I bind to the gateway service and let it handle the transfer?

@KomachiSion
Copy link
Collaborator

Nacos 是 mcp服务相关元数据的存储, 包括了mcp服务中实际提供能力的服务信息,tool的path元信息等。

我理解你的问题就是在创建mcp服务的时候,选择后段服务为http类型,实际提供者选择网关服务,然后tool的元信息里填网关暴露的实际path

@KomachiSion KomachiSion added the kind/question Category issues related to questions or problems label May 29, 2025
@panda-ace
Copy link
Author

是的,在昨天我填写了相关配置,服务引用选择的是网关服务gateway,在tool元信息里填写了网关的实际中转路径,实现路由中转

Image

Image
除此之外还有其他方法实现路由中转吗?
比如说nacos提供的是mcp服务相关的元数据,对于需要经过业务网关的api,那么我通过配置Higress的路由规则,将请求转发到gateway的地址,配置Spring Gateway的路由规则,Higress → Spring Gateway → 业务服务

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Category issues related to questions or problems
Projects
None yet
Development

No branches or pull requests

2 participants